<%--
  Created by IntelliJ IDEA.
  User: xin
  Date: 2024/9/19
  Time: 下午3:15
  To change this template use File | Settings | File Templates.
--%>
<%@page  language="java" import="java.text.*,java.util.*" contentType="text/html;chareast=UTF-8" pageEncoding="UTF-8"%>
<html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>处理留言</title>

</head>
<body bgcolor="#abcdef">
<%! Vector<String> v =new Vector<String>();
int i=0;
        %>
<%
    String detetime=new SimpleDateFormat("yyy-MM-dd hh:mm:ss").format(Calendar.getInstance().getTime());
%>
<%
    request.setCharacterEncoding("UTF-8");
    String name=request.getParameter("name");
    String title =request.getParameter("title");
    String message =request.getParameter("massage");
%>
<%
    if(name == null ||"".equals(name.trim())){
        //trim()主要解决里面只有空格的问题
    name = "网友"+(int)(Math.random()*100000+10000);
    }
    if(title == null ||"".equals(title.trim())){
        title="无";
    }
    if(message == null ||"".equals(message.trim())){
        message="无";
    }
%>
<%
    i++;
    String str="第"+"<span class=span0>"+i+"</span>"+"楼"+".<span class=span1>留言人：</span>"+name+".<span class=span2>" +
            "标题：</span>"+title+".<span class=span3>内容：</span><br>"+message+".<span class=span4>" +
            "时间：</span>"+detetime+".<hr>";
    v.add(str);
    application.setAttribute("message",v);
%>
留言成功.
<a href="inputMessage.jsp">返回留言板</a>
</body>
</html>